<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title></title>
		<style>
			.big{
				position: fixed;
				z-index: 5;
				top: 0px;
				left: 0px;
				width: 100%;
				height: 100%;
				object-fit: cover;
			}
			.small{
				position: fixed;
				z-index: 6;
				top: 25px;
				right: 15px;
				width: 120px;
				height: 260px;
				object-fit: cover;
			}
		</style>
	</head>
	<body style="padding:0px;margin:0px;height: 100vh;width: 100%;overflow: hidden;">
		
		<div id="app">
			<video src="" poster="./images/mt/pt.png" id="vd_user" autoplay style="position: fixed;top: 0px;left: 0px;z-index: 5;width: 100%;height: 100%;object-fit: cover;"></video>
			<video src="" muted="true" poster="./images/mt/pt.png" id="vd_my" autoplay style="position: fixed;top: 20px;right: 25px;z-index: 6;width: 100px;height: 230px;"></video>
			
			<div style="display: flex;justify-content: center;position: fixed;bottom: 25px;left: 0px;width: 100%;z-index: 9;">
				<img @click="exit" src="./images/mt/icon_guad.png" style="width: 60px;height: 60px;" alt="" />
			</div>
			
			<img @click="changeCamera" src="./images/mt/camerachange.png" style="width: 40px;height: 40px;position: fixed;bottom:30px;right:30px;z-index: 9;" alt="" />
		</div>
		
		<script type="text/javascript" src="./js/uni.webview.1.5.4.js">
		</script>
		<!-- 引入vue方法-->
		<script src="./js/vue.js"></script>
		<script type="text/javascript" src="./js/videochat.js"></script>
		<script type="text/javascript" charset="utf-8">
			function getQueryVariable(variable) {
				var query = window.location.search.substring(1);
				var vars = query.split("&");
				for (var i = 0; i < vars.length; i++) {
					var pair = vars[i].split("=");
					if (pair[0] == variable) {
						return pair[1];
					}
				}
				return "";
			};
			
			const roomId = getQueryVariable("roomId")
			const id = getQueryVariable("id")
			const name = getQueryVariable("name")
			const friend_id = getQueryVariable("friend_id")
			const friend_name = getQueryVariable("friend_name")
			app.initData({id,name,friend_id,friend_name,roomId})
			
			document.addEventListener('UniAppJSBridgeReady', function() {
				uni.getEnv(function(res) {
					console.log('获取当前环境：' + JSON.stringify(res));
					app.publishStream({video:true,audio:false})
				});
			});
		</script>
	</body>
</html>